<?php
header("Access-Control-Allow-Origin:*");
require("../lib/init.php");
require("../pojo/role.php");
require("../pojo/token.php");
$token = $_GET['token'];
if (empty($token)) exit("缺少必要参数");
if (!checkToken($token)){
    $code = 400;
    $msg = "无权限";
    $data = array("roleinfo" => "无权限");
}else{
    $code = 200;
    $msg = "获取数据成功！";
    $data = array(
        "roleinfo" => getRoleCount()
    );
}
echo json_encode(result($code,$msg,$data));